import request from '@/utils/request.js'

export const getDeviceAdList = (params) => {
  return request({
    url: '/device/index',
    method: 'get',
    params
  })
}
export const getDeviceNameAdList = (data) => {
  return request({
    url: '/device/index?community_code=' + data,
    method: 'get',

  })
}

export const addDeviceAdList = (data) => {
  return request({
    url: '/device/index',
    method: 'post',
    data
  })
}

export const getDeviceAdInfo = (id) => {
  return request({
    url: '/device/index/' + id,
    method: 'get',
  })
}

export const editDeviceAdList = (data) => {
  return request({
    url: '/device/index/' + data.id,
    method: 'put',
    data
  })
}

export const delDeviceAdList = (id) => {
  return request({
    url: '/device/index/' + id,
    method: 'delete',
  })
}
